﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Online.aspx.cs" Inherits="UCenter.Web.Views.Friend.Online"
    Title="无标题页" %>

<asp:content id="Content2" contentplaceholderid="head" runat="server">
 <script type="text/javascript" src="/Content/jquery.json-1.2.js"></script>
 <script type="text/javascript" src="/Content/ui.js"></script>
 <script type="text/javascript">
   $(document).ready(function(){
       $('#loadFriendImg').show();
       $.ajax({
           type:'GET',
           url:'GetOnlineFriends',
           dataType:'json',
           success:function(res){
               var data = res;
               var column = 6;
               var html="<tr>";
               $('#friendList tr').remove();
               $.each(data,function(i){                   
                   var c = data[i];
                   if((i%column)==0&&i>0)
                   {                   
                      html+="<tr>";    
                   } 
                   html+="<td style='padding-left:10px'><img src='"+data[i].LogoUrl+"' width='50px' height='50px'/></td><td  valign='top'><img src='/Themes/Standard/Images/u_zx1.gif'/><a href='javascript:void(0);'>"+data[i].TrueName+"</a></td>";   
                   if(i==data.length-1){
                      var k =data.length%column;                    
                      for(var p=0;p<k;p++){
                         html+="<td></td><td></td>";
                      }
                   }
                   if(i%column==(column-1)&&i>0)
                   {  
                      html+="</tr>";
                   }                      
               });
               $('#friendList').html(html);
               $('#loadFriendImg').hide();
               $('#friendList').fadeIn('fast');
           },
           error:function(){
               $('#loadFriendImg').hide();
               alert('get online friend error!');
           }
       });       
   });
 </script>
</asp:content>
<asp:content id="Content1" contentplaceholderid="MainContent" runat="server">
<h2><img src='/Themes/Standard/Images/ico_hy.gif' align="middle"/>在线好友</h2>
  <div class='modalMessage' id='msg' style="margin:10px;">下面的几位好友很您一样,都处于在线状态：</div> 
 
  <img src='/Content/Images/loading.gif' id='loadFriendImg' style="display:none" /> 
  <table id='friendList' cellpadding="8" cellspacing="8" style="margin-top:5px; display:none;">              
  </table>
</asp:content>
